package com.itheima.mapper;

import com.itheima.entity.Clazz;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClassMapper {
    // 分页查询
    @Select("select *from clazz.clazz limit #{page},#{pageSize}")
    List<Class> pageQuery(Integer page, Integer pageSize);
    //分页查询
    @Select("select count(*) from clazz.clazz")
    Integer count();

    void delete(List<Integer> id);
    @Insert("insert into clazz.clazz(id, name, room,begin,end,create_time, update_time)" +
            " values (null,#{name},#{room},#{begin},#{end},#{createTime},#{updateTime});")
    void insert(Clazz clazz);
}
